<template>
	<view v-if="userInfo">
		<uni-nav-bar :fixed="true" left-icon="back" title="账户设置" @clickLeft="leftBack" background-color="#318cff" color="#fff"></uni-nav-bar>
		<view class="dfj-bg-white dfj-overflow-hide">
			<navigator url="/pages/my/set-head" class="dfj-bd-b-e5e dfj-flex dfj-flex-ai-c dfj-pd-20">
				<view class="dfj-flex-1 dfj-flex dfj-flex-ai-c">
					<image style="width: 80rpx;height: 80rpx;border-radius: 100%;" :src="userInfo.headIcon || '/static/img/login.png'"/><text class="dfj-mg-l-30 dfj-f-35 dfj-t-333">{{ userInfo.userName }}</text>
				</view>
				<view class="dfj-t-666"><text class="dfj-icon icon-arrow-right"></text></view>
			</navigator>
			<navigator url="/pages/home/address?set=true" class="dfj-flex dfj-flex-ai-c dfj-pd-lr-20 dfj-pd-tb-30">
				<view class="dfj-flex-1 dfj-t-333 dfj-f-28">地址管理</view>
				<view class="dfj-t-666"><text class="dfj-icon icon-arrow-right"></text></view>
			</navigator>
		</view>
		
		<view class="dfj-bg-white dfj-overflow-hide dfj-mg-t-20">
			<navigator url="/pages/my/set-payment-code" class="dfj-bd-b-e5e dfj-flex dfj-flex-ai-c dfj-pd-lr-20 dfj-pd-tb-30">
				<view class="dfj-flex-1 dfj-t-333 dfj-f-28">设置支付密码</view>
				<view class="dfj-t-666"><text class="dfj-icon icon-arrow-right"></text></view>
			</navigator>
			<view @click="toBank" class="dfj-flex dfj-flex-ai-c dfj-pd-lr-20 dfj-pd-tb-30">
				<view class="dfj-flex-1 dfj-t-333 dfj-f-28">管理收款账号</view>
				<view class="dfj-t-666"><text class="dfj-icon icon-arrow-right"></text></view>
			</view>
		</view>
		
		<navigator url="/pages/user/login" class="dfj-pd-tb-50 dfj-pd-lr-20">
			<button type="primary" style="width: 100%;border-radius: 20rpx;" @click="exit()">退出当前账号</button>
		</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: ''
			}
		},
		onShow() {
			this.userInfo = JSON.parse(localStorage.getItem('loginInfo')).userInfo;
		},
		methods: {
			leftBack() {
				uni.navigateBack();
			},
			toBank() {
				if(this.userInfo.isAuthentication!=1){
					uni.navigateTo({
						url: '/pages/my/certification'
					})
				}else{
					uni.navigateTo({
						url: '/pages/my/set-bank'
					})
				}
			},
			exit() {
				uni.reLaunch({
					url: '/pages/user/login'
				})
			}
		}
	}
</script>

<style>
</style>
